Here, I want to investigate if a velocity based visualization is able to capture trajectories, even if intermediate populations are missing. To do this, I will use the pancreas development dataset from scVelo and remove cell types that are in the intermediate stages of the endocrine development trajectory.
Note: using weighted graphs vs unweighted graphs and more cells than in first graph_pancViz analysis.. so results are slightly different.
Use the reticulate package to use scVelo from within R:
Extract spliced and unspliced data
Extract PCA coordinates
Filter genes
Downsample cells to make things easier
Normalize for dimensional reduction
## Warning in if (!class(counts) %in% c("dgCMatrix", "dgTMatrix")) {: the condition
## has length > 1 and only the first element will be used
## Converting to sparse matrix ...
## Normalizing matrix with 3696 cells and 8636 genes
Dimensional reduction
Run velocyto on panc data
Scores of observed and projected states in PC space
Graph visualization on subset of cells from PC coordinates
First, we’ll see if removing Ngn3 low EP cell types affects the visualization. Given that there are only relatively few of these cells, I suspect that the effect won’t be noticeable in the visualization.
As expected, the visualization doesn’t change very much by removing Ngn3 low EP cells. Next, let’s see the effect of removing Ngn3 high EP or Pre-endocrine cells.
First, remove pre-endocrine cells..
## [1] "Done finding neighbors"
## [1] "Done making graph"
…and now Ngn3 high EP
## [1] "Done finding neighbors"
## [1] "Done making graph"
Let’s try removing multiple subsets, Ngn3 highEP and Pre-endocrine
## [1] "Done finding neighbors"
## [1] "Done making graph"
## [1] "Done finding neighbors"
## [1] "Done making graph"
Remove a proportion of cells from one of the terminal cell types..
## [1] "Done finding neighbors"
## [1] "Done making graph"